<!--  -->
<template>
  <div class="footer_guide">
    <a
      v-for="item in menuListArr"
      href="javascript:;"
      class="guide_item"
      :key="item.path"
      :class="item.path === currentRoute && 'on'"
      @click="changeRoute(item.path)"
    >
      <span class="item_icon">
        <i :class="item.icon"></i>
      </span>
      <span>{{ item.title }}</span>
    </a>
  </div>
</template>

<script>
import menuList from "@/utils";
export default {
  data() {
    return {
      currentRoute: "",
    };
  },
  methods: {
    changeRoute(path) {
      this.currentRoute = path;
      this.$router.replace(path);
    },
  },
  mounted() {
    this.currentRoute = window.location.href.split("#")[1];
  },
  computed: {
    menuListArr() {
      return menuList;
    },
  },
};
</script>
<style lang="stylus" rel="stylesheet/stylus">
@import '../../common/stylus/mixins.styl';

.footer_guide { // footer
  top-border-1px(#e4e4e4);
  position: fixed;
  z-index: 100;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fff;
  width: 100%;
  height: 50px;
  display: flex;

  .guide_item {
    display: flex;
    flex: 1;
    text-align: center;
    flex-direction: column;
    align-items: center;
    margin: 5px;
    color: #999999;

    &.on {
      color: #ff2d4a;
    }

    span {
      font-size: 12px;
      margin-top: 2px;
      margin-bottom: 2px;

      .iconfont {
        font-size: 22px;
      }
    }
  }
}
</style>